layui.use(['form','layer','laydate','table','laytpl'],function(){
    var form = layui.form,
        layer = parent.layer === undefined ? layui.layer : top.layer,
        $ = layui.jquery,
        laydate = layui.laydate,
        laytpl = layui.laytpl,
        table = layui.table;

    //列表
    var tableIns = table.render({
        elem: '#entityList',
        url : '/address/JsonList?memberId='+$("#memberId").val(),
        cellMinWidth : 95,
        page : true,
        height : "full-125",
        limit : 20,
        method:'post',
        limits : [10,15,20,25],
        id : "entityList",
        cols : [[
            {type: 'numbers', title: 'ID',align:'center',width:60},
            {field: 'name', title: '姓名',align:'center',width:120},
            {field: 'phone', title: '手机号',align:'center',width:120},
            {field: 'type', title: '默认地址',align:'center',width:120, templet:function(d){
                if(d.type=="1"){
                    return "是";
                }else {
                    return "否";
                }
            },minWidth:100},
            {field: 'province', title: '地址',align:'center', templet:function(d){
                return d.province+"  "+d.descripts;
            }},
            {field: 'createTime', title: '创建时间', align:'center', width:180, templet:function(d){
                return d.createtime;
            }}
        ]]
    });

    //搜索
    $(".search_btn").on("click",function(){
        table.reload("entityList",{
            page: {
                curr: 1 //重新从第 1 页开始
            },
            where: {
                name: $("#name").val(),
                phone: $("#phone").val(),
            }
        })
    });

})